<?php
namespace app\admin\controller;

use think\facade\Db;
use think\facade\View;

class Goods{
    public function goodList()
    {
        $list=Db::name('goods')->alias('g')->join(['ecm_category'=> 'c'],'c.id=g.cid')->column('g.id,g.name,g.photo_x,price,c.name as cname,g.addtime,g.is_show,g.is_hot,g.is_down');

        View::assign("list",$list);
        return view();
    }
    public function goodAdd()
    {
        return View::fetch();
    }
    public function cate()
    {
        $list=Db::name('category')->where("parentid",'0')->select()->toArray();
        View::assign('list',$list);
        return view();
    }
    public function cateedit()
    {
        return View::fetch();
    }

}